﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Text;
using BlueSkySOA.Service.SMSService.ApplicationService.Messaging;
using BlueSkySOA.Service.SMSService.ApplicationService;
using BlueSkySOA.Service.SMSService.DataContracts;
using BlueSkySOA.Service.SMSService.ApplicationService.Impl;
namespace BlueSkySOA.Service.SMSService.Impl
{
    
    public class SmsService : ISmsService
    {
        private ISmsApplicationService _smsApplicationService;
        public SmsService(ISmsApplicationService smsApplicationService)
        {
            _smsApplicationService = smsApplicationService;
        }
        
        #region ISmsService Members

        public bool SendSMS(SmsSendRequest smsRequest)
        {
            SendSmsRequest sendSmsRequest = new SendSmsRequest() { ProxySmsKey = smsRequest.ProxySmsKey
                                                                  , Country = smsRequest.Country
                                                                  , PhoneNumber = smsRequest.PhoneNumber
                                                                  , Message = smsRequest.Message
                                                                  , ServiceType = smsRequest.ServiceType};           
            SendSmsResponse sendSmsResponse = _smsApplicationService.SendSms(sendSmsRequest);
            return sendSmsResponse.ResultValue;
        }
        public string TestService(string serviceName)
        {
            if (_smsApplicationService!= null)
                return serviceName;
            return "Application Service null";
        }
        #endregion


        
    }
}
